﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace NerdDinner.Data.Entities
{
    [Serializable]
    public class Point
    {
        //[NonSerialized]
        //IList<Walk> _walks;
        public virtual short PointId{get; private set;}
        public virtual double lat { get; set; }
        public virtual double lng { get; set; }

        [JsonIgnore]
        public virtual IList<Walk> Walks { get; set; } 
        //{ 
        //    get { return _walks;}
        //    set { _walks = value; }
        //}

        public Point()
        {
            Walks = new List<Walk>();
        }
 
        public virtual void AddWalk(Walk walk)
        {
            walk.Point = this;
            Walks.Add(walk);
        }
    }
}
